package com.ftdigital.primemovers_operators.fragment;


import android.app.ActionBar;
import android.os.AsyncTask;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.View;
import android.widget.ImageButton;
import android.widget.TextView;

import com.ftdigital.primemovers_operators.MainActivity;
import com.ftdigital.primemovers_operators.R;
import com.ftdigital.primemovers_operators.model.BaseModel;
import com.ftdigital.primemovers_operators.util.XTHttp;
import com.ftdigital.primemovers_operators.util.http.RetryHandler;
import com.google.gson.Gson;

import org.androidannotations.annotations.EFragment;
import org.androidannotations.annotations.ViewById;

import java.util.List;

/**
 * A simple {@link Fragment} subclass.
 */
public abstract class BaseFragment extends Fragment {
    static Gson gson = new Gson();
    abstract  void initView();
    abstract  void Click(View view);
    static XTHttp xtHttp = new XTHttp();
    BaseModel baseModel;

    protected  int currentPage = 0;

    protected static String requestUrl = "";//访问地址
    protected static String requestParams = "";//访问参数

    protected String logInfo(String showinfo) {
        return null;
    }

    private String getCache() {
        return new StringBuilder(getCachePrifix()).append("_").append(currentPage).toString();
    }

    protected String getCachePrifix() {
        return null;
    }
//测试
    protected class CacheTask extends AsyncTask<String, Void, String> {

        @Override
        protected String doInBackground(String... strings) {
            Log.i("curry", "logInfo:"+logInfo(strings[0]));
            return logInfo(strings[0]);
        }
    }

    //缓存存在且有效
    private boolean isReadCacheData() {
        return true;
    }
}
